home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / etc / subst-strings < prev   
Text File  |  1993-04-27  |  2KB  |  117 lines

  1. #!/bin/sh
  2. #
  3. # substitute various values for ||STRINGS|| 
  4. #
  5.  
  6. set -e
  7.  
  8. usage()
  9. {
  10.   echo "usage: $0 host target release-date bundle bindir srcdir inputfile outputfile"
  11.   exit 1
  12. }
  13.  
  14. if [ $# != 8 ] ; then 
  15.   usage
  16. fi
  17.  
  18. HOSTstr=$1
  19. TARGETstr=$2
  20. RELNO=$3
  21. BUNDLE=$4
  22. BINDIR=$5
  23. SRCDIR=$6
  24. INFILE=$7
  25. OUTFILE=$8
  26.  
  27. GCCvn=`awk '{printf "%s", substr ($4, 2, length ($4) - 3); }' ${SRCDIR}/gcc/version.c`
  28.  
  29. if [ $BUNDLE = "comp-tools" ] ; then
  30.   if [ ! $TARGETstr = $HOSTstr ] ; then
  31.     BUNDLE=cross-tools
  32.   fi
  33. fi
  34.  
  35. TAPEdflt=QIC-24
  36. RELEASEDIR=progressive
  37. INSTALLdir=/usr
  38.  
  39. case $HOSTstr in 
  40.   sparc-sun-solaris2)
  41.         NICK=solaris2
  42.     HOST="Sun-4"
  43.     DEVdflt="/dev/rmt/0n"
  44.     ;;
  45.   sparc-sun-sunos4.1.1)
  46.     NICK=sun4
  47.     HOST="Sun-4"
  48.     DEVdflt=/dev/nrst8
  49.       ;;
  50.   m68k-sun-sunos4.1.1)
  51.     NICK=sun3
  52.     HOST="Sun-3"
  53.     DEVdflt=/dev/nrst8
  54.     ;;
  55.   mips-dec-ultrix)
  56.     NICK=decstation
  57.     HOST="DECstation"
  58.     DEVdflt=/dev/nrtm0
  59.     ;;
  60.   mips-sgi-irix4)
  61.     NICK=iris
  62.     HOST="Iris"
  63.     DEVdflt=/dev/mt/tps0d0nrns
  64.     ;;
  65.   rs6000-ibm-aix)
  66.     NICK=rs6000
  67.     HOST="RS/6000"
  68.     DEVdflt=/dev/rmt0
  69.     ;;
  70.   m68k-hp-hpux)
  71.     NICK=hp300
  72.     HOST="HP 9000/300"
  73.     DEVdflt=/dev/rmt/0mn
  74.     TAPEdflt=DAT
  75.     ;;
  76.   hppa1.1-hp-hpux)
  77.     NICK=hppa
  78.     HOST="HP 9000/700"
  79.     DEVdflt=/dev/rmt/0mn
  80.     TAPEdflt=DAT
  81.     ;;
  82.   i386-sco3.2v4)
  83.     NICK=SCO
  84.     HOST="PC running SCO"
  85.     DEVdflt=
  86.     ;;
  87. esac
  88.  
  89. TARGET=$TARGETstr
  90.  
  91. bindu=`du ${DUFLAGS--s} $BINDIR | awk '{print $1}'`
  92. BINSIZE=`expr $bindu / 1000`
  93. srcdu=`du ${DUFLAGS--s} $SRCDIR | awk '{print $1}'`
  94. SRCSIZE=`expr $srcdu / 1000`
  95.  
  96. TOTALDISK=`expr $BINSIZE + $SRCSIZE`
  97.  
  98. set -x
  99.  
  100. sed     -e "s,\|\|RELNO\|\|,$RELNO,g" \
  101.         -e "s,\|\|GCCvn\|\|,$GCCvn,g" \
  102.     -e "s,\|\|HOSTstr\|\|,$HOSTstr,g" \
  103.     -e "s,\|\|HOST\|\|,$HOST,g" \
  104.     -e "s,\|\|TARGETstr\|\|,$TARGETstr,g" \
  105.     -e "s,\|\|TARGET\|\|,$TARGET,g" \
  106.     -e "s,\|\|BUNDLE\|\|,$BUNDLE,g" \
  107.     -e "s,\|\|DEVdflt\|\|,$DEVdflt,g" \
  108.     -e "s,\|\|TAPEdflt\|\|,$TAPEdflt,g" \
  109.     -e "s,\|\|TAPdflt\|\|,$TAPEdflt,g" \
  110.     -e "s,\|\|INSTALLdir\|\|,$INSTALLdir,g" \
  111.     -e "s,\|\|BD\|\|,$BINSIZE,g" \
  112.     -e "s,\|\|SD\|\|,$SRCSIZE,g" \
  113.     -e "s,\|\|DF\|\|,$TOTALDISK,g" \
  114.     -e "s,\|\|RELEASEDIR\|\|,$RELEASEDIR,g" \
  115.     -e "s,^@clear HOST${NICK},@set HOST${NICK}," \
  116.     < $INFILE > $OUTFILE
  117.